import Ajax from './Ajax'
import { PRESENT_ADD, PRESENT_DELETE, PRESENT_LIST, PRESENT_UPDATE, SAMPLE_ADD, SAMPLE_DELETE, SAMPLE_LIST, SAMPLE_UPDATE } from './url.config'
// 定义样品管理接口

/** 获取样品列表数据接口定义 */
export function sampleListlApi (name) {
  return Ajax({
    url: SAMPLE_LIST,
    params: { page: 1, size: 20, name: name }
  })
}

/** 获取样品修改接口定义 */
export function sampleUpdateApi (data) {
  return Ajax({
    url: SAMPLE_UPDATE,
    method: 'POST',
    data
  })
}

/** 获取样品删除接口定义 */
export function sampleDeleteApi (id) {
  return Ajax({
    url: SAMPLE_DELETE + id,
    method: 'DELETE'
  })
}

/** 获取样品新增接口定义 */
export function sampleAddApi (data) {
  return Ajax({
    url: SAMPLE_ADD,
    method: 'PUT',
    data
  })
}

/** 礼品列表获取 */
export function presentListlApi (name) {
  return Ajax({
    url: PRESENT_LIST,
    params: { page: 1, size: 20, name: name }
  })
}

/** 获取礼品修改接口定义 */
export function presentUpdateApi (data) {
  return Ajax({
    url: PRESENT_UPDATE,
    method: 'POST',
    data
  })
}

/** 获取礼品删除接口定义 */
export function presentDeleteApi (id) {
  return Ajax({
    url: PRESENT_DELETE + id,
    method: 'DELETE'
  })
}

/** 获取礼品新增接口定义 */
export function presentAddApi (data) {
  return Ajax({
    url: PRESENT_ADD,
    method: 'PUT',
    data
  })
}
